package info.magnolia.blossom.sample.cv.components;

import info.magnolia.module.blossom.annotation.TabFactory;
import info.magnolia.module.blossom.annotation.Template;
import info.magnolia.module.blossom.annotation.TemplateDescription;
import info.magnolia.module.blossom.dialog.TabBuilder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created with IntelliJ IDEA.
 * User: valentinzuld
 * Date: 3/1/13
 * Time: 11:22 AM
 * To change this template use File | Settings | File Templates.
 */
@Template(title = "Two Columns", id = "blossomSample:components/twocolumns")
@TemplateDescription("2 Column Stories")
@Controller
public class TwoColumnsComponent {
    @RequestMapping("/cvtemplate/twocolumns")
    public String render(){
        return "components/twoColumns.jsp";
    }

    @TabFactory("Second Column")
    public void secondTab(final TabBuilder tab) {
        tab.addEdit("secondTitle", "Title", "Story Title");
        tab.addFckEditor("secondText", "Text", "Story text");
        tab.addEdit("secondButtonText", "Button Text", "");
        tab.addUuidLink("secondButtonLink", "Button Link", "");
    }
    @TabFactory("First Column")
    public void firstTab(final TabBuilder tab) {
        tab.addEdit("firstTitle", "Title", "Story Title");
        tab.addFckEditor("firstText", "Text", "Story text");
        tab.addEdit("firstButtonText", "Button Text", "");
        tab.addUuidLink("firstButtonLink", "Button Link", "");
    }
}
